package org.domeos.framework.api.controller.productLine;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.domeos.basemodel.HttpResponseTemp;
import org.domeos.basemodel.ResultStat;
import org.domeos.framework.api.controller.ApiController;
import org.domeos.framework.api.service.productLine.productLineService;
import org.domeos.framework.engine.RedisUtil;
import org.domeos.framework.engine.exception.DaoException;
import org.domeos.global.GlobalConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@Api("产品线相关api")
public class ProductLineController extends ApiController {

    @Autowired
    productLineService productLineService;
    
    @ApiOperation(value="获取下两级产品树")
    @ResponseBody
    @RequestMapping(value = "/productline/tree/", method = RequestMethod.GET)
    public HttpResponseTemp<?> getNextTwoLevelProductLineTree() throws DaoException {
    	return ResultStat.OK.wrap(RedisUtil.getStringRedisTemplate().opsForValue().get(GlobalConstant.GDOCKER_PRODUCT_TREE));
    }
}